<?php
/**
 * User: tridungpham
 * Date: 7/6/11
 * Time: 11:07 AM
 */
 
class ModuleModel extends Model
{
    function getModuleSet($template_id)
    {
        $sql = "select m.name as module_name,b.name as block_name,module_id,block_id,mb.order
                from modules m,template_blocks b,modules_blocks mb
                where
                    b.template_id = $template_id
                    and m.id = mb.module_id
                    and b.id = mb.block_id
                    and  m.status = 1
                order by block_id,mb.order";
        $db = DataProvider::getInstance();
        return $db->_query($sql);
    }
}